API: remove gdk_draw_point(s)
authorBenjamin Otte <otte@redhat.com>
Thu, 15 Jul 2010 16:07:42 +0000 (18:07 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 10 Aug 2010 19:02:27 +0000 (21:02 +0200)
12 files changed:
docs/reference/gdk/gdk3-sections.txt
docs/reference/gdk/tmpl/drawing.sgml
gdk/directfb/gdkdrawable-directfb.c
gdk/gdk.symbols
gdk/gdkdraw.c
gdk/gdkdrawable.h
gdk/gdkoffscreenwindow.c
gdk/gdkpixmap.c
gdk/gdkwindow.c
gdk/quartz/gdkdrawable-quartz.c
gdk/win32/gdkdrawable-win32.c
gdk/x11/gdkdrawable-x11.c

index b284d0eafc2afe79c7b10551966cf0494d696890..0fd907b7d28ea1efa3c06202873dadb337416ca8 100644 (file)
@@ -334,8 +334,6 @@ gdk_drawable_get_clip_region
 gdk_drawable_get_visible_region
 
 <SUBSECTION>
-gdk_draw_point
-gdk_draw_points
 gdk_draw_rectangle
 gdk_draw_layout_line
 gdk_draw_layout_line_with_colors
index 25f5e13a6ebf8ad74174596e95a678507424ab6b..fc5c18f5c66b7356eeb67523ea2804ad0654d1e6 100644 (file)
@@ -127,26 +127,6 @@ or a #GdkWindow.
 @Returns: 
 
 
-<!-- ##### FUNCTION gdk_draw_point ##### -->
-<para>
-</para>
-
-@drawable: 
-@gc: 
-@x: 
-@y: 
-
-
-<!-- ##### FUNCTION gdk_draw_points ##### -->
-<para>
-</para>
-
-@drawable: 
-@gc: 
-@points: 
-@n_points: 
-
-
 <!-- ##### FUNCTION gdk_draw_rectangle ##### -->
 <para>
 </para>
index e89bdc2e684f9eff0cfbdf78ee7daf4df535d65d..238e92e08e502ae349b49f1bf0384a607475c107 100644 (file)
@@ -605,54 +605,6 @@ gdk_directfb_draw_drawable (GdkDrawable *drawable,
   temp_region_deinit( &clip );
 }
 
-static void
-gdk_directfb_draw_points (GdkDrawable *drawable,
-                          GdkGC       *gc,
-                          GdkPoint    *points,
-                          gint         npoints)
-{
-  GdkDrawableImplDirectFB *impl;
-  cairo_region_t                clip;
-
-  DFBRegion region = { points->x, points->y, points->x, points->y };
-
-  D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %p, %d )\n", G_STRFUNC, drawable, gc, points, npoints );
-
-  if (npoints < 1)
-    return;
-
-  impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
-
-  if (!gdk_directfb_setup_for_drawing (impl, GDK_GC_DIRECTFB (gc)))
-    return;
-
-  gdk_directfb_clip_region (drawable, gc, NULL, &clip);
-
-  while (npoints > 0)
-    {
-      if (cairo_region_contains_point (&clip, points->x, points->y))
-        {
-          impl->surface->FillRectangle (impl->surface,
-                                        points->x, points->y, 1, 1);
-
-          if (points->x < region.x1)
-            region.x1 = points->x;
-          if (points->x > region.x2)
-            region.x2 = points->x;
-
-          if (points->y < region.y1)
-            region.y1 = points->y;
-          if (points->y > region.y2)
-            region.y2 = points->y;
-        }
-
-      npoints--;
-      points++;
-    }
-
-  temp_region_deinit( &clip );
-}
-
 static inline void
 convert_rgba_pixbuf_to_image (guint32 *src,
                               guint    src_pitch,
@@ -751,7 +703,6 @@ gdk_drawable_impl_directfb_class_init (GdkDrawableImplDirectFBClass *klass)
   drawable_class->create_gc      = _gdk_directfb_gc_new;
   drawable_class->draw_rectangle = gdk_directfb_draw_rectangle;
   drawable_class->draw_drawable  = gdk_directfb_draw_drawable;
-  drawable_class->draw_points    = gdk_directfb_draw_points;
 
   drawable_class->ref_cairo_surface = gdk_directfb_ref_cairo_surface;
   drawable_class->set_colormap   = gdk_directfb_set_colormap;
index e0616c6bb73945d282d1b6427c66cbba837a8ecc..1bc019af6deda24a0a1834dd57643b6bde45daa9 100644 (file)
@@ -550,8 +550,6 @@ gdk_drawable_get_visible_region
 gdk_drawable_get_visual
 gdk_drawable_set_colormap
 gdk_draw_drawable
-gdk_draw_point
-gdk_draw_points
 gdk_draw_rectangle
 #endif
 #endif
index 832685abe70bfc6a4bf72320493fd4e5f93480aa..1051e44d57dcc9d44c06b340e2a6f5979dbe4ac3 100644 (file)
@@ -214,33 +214,6 @@ gdk_drawable_get_colormap (GdkDrawable *drawable)
 /* Drawing
  */
 
-/**
- * gdk_draw_point:
- * @drawable: a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
- * @gc: a #GdkGC.
- * @x: the x coordinate of the point.
- * @y: the y coordinate of the point.
- * 
- * Draws a point, using the foreground color and other attributes of 
- * the #GdkGC.
- **/
-void
-gdk_draw_point (GdkDrawable *drawable,
-                GdkGC       *gc,
-                gint         x,
-                gint         y)
-{
-  GdkPoint point;
-
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-  g_return_if_fail (GDK_IS_GC (gc));
-
-  point.x = x;
-  point.y = y;
-  
-  GDK_DRAWABLE_GET_CLASS (drawable)->draw_points (drawable, gc, &point, 1);
-}
-
 /**
  * gdk_draw_rectangle:
  * @drawable: a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
@@ -382,34 +355,6 @@ gdk_draw_drawable (GdkDrawable *drawable,
   g_object_unref (composite);
 }
 
-/**
- * gdk_draw_points:
- * @drawable: a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
- * @gc: a #GdkGC.
- * @points: an array of #GdkPoint structures.
- * @n_points: the number of points to be drawn.
- * 
- * Draws a number of points, using the foreground color and other 
- * attributes of the #GdkGC.
- **/
-void
-gdk_draw_points (GdkDrawable    *drawable,
-                GdkGC          *gc,
-                const GdkPoint *points,
-                gint            n_points)
-{
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-  g_return_if_fail ((points != NULL) && (n_points > 0));
-  g_return_if_fail (GDK_IS_GC (gc));
-  g_return_if_fail (n_points >= 0);
-
-  if (n_points == 0)
-    return;
-
-  GDK_DRAWABLE_GET_CLASS (drawable)->draw_points (drawable, gc,
-                                                  (GdkPoint *) points, n_points);
-}
-
 static GdkDrawable *
 gdk_drawable_real_get_composite_drawable (GdkDrawable *drawable,
                                           gint         x,
index c0d88f2271e937a55e6b8077e7ff085163f08575..de741d3664cf9a5c242a56b4f8d15969e618f724 100644 (file)
@@ -76,10 +76,6 @@ struct _GdkDrawableClass
                          gint          ydest,
                          gint          width,
                          gint          height);
-  void (*draw_points)   (GdkDrawable  *drawable,
-                         GdkGC        *gc,
-                         GdkPoint     *points,
-                         gint          npoints);
 
   gint (*get_depth)      (GdkDrawable  *drawable);
   void (*get_size)       (GdkDrawable  *drawable,
@@ -154,10 +150,6 @@ GdkDisplay*        gdk_drawable_get_display  (GdkDrawable    *drawable);
 
 /* Drawing
  */
-void gdk_draw_point     (GdkDrawable      *drawable,
-                        GdkGC            *gc,
-                        gint              x,
-                        gint              y);
 void gdk_draw_rectangle (GdkDrawable      *drawable,
                         GdkGC            *gc,
                         gboolean          filled,
@@ -174,10 +166,6 @@ void gdk_draw_drawable  (GdkDrawable      *drawable,
                         gint              ydest,
                         gint              width,
                         gint              height);
-void gdk_draw_points    (GdkDrawable      *drawable,
-                        GdkGC            *gc,
-                        const GdkPoint   *points,
-                        gint              n_points);
 
 void gdk_draw_layout_line (GdkDrawable      *drawable,
                           GdkGC            *gc,
index 2ee6f9ec27c59654e150fd01e450fad384968323..d582a08e7a4626f7b7c84b86d698d42c5a6233ab 100644 (file)
@@ -323,43 +323,6 @@ gdk_offscreen_window_draw_rectangle (GdkDrawable  *drawable,
 
 }
 
-static void
-gdk_offscreen_window_draw_points (GdkDrawable  *drawable,
-                                 GdkGC        *gc,
-                                 GdkPoint     *points,
-                                 gint          npoints)
-{
-  GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (drawable);
-  GdkDrawable *real_drawable = get_real_drawable (offscreen);
-
-  gdk_draw_points (real_drawable,
-                  gc,
-                  points,
-                  npoints);
-
-
-  if (npoints > 0)
-    {
-      int min_x, min_y, max_x, max_y, i;
-
-      min_x = max_x = points[0].x;
-      min_y = max_y = points[0].y;
-
-       for (i = 1; i < npoints; i++)
-         {
-           min_x = MIN (min_x, points[i].x);
-           max_x = MAX (max_x, points[i].x);
-           min_y = MIN (min_y, points[i].y);
-           max_y = MAX (max_y, points[i].y);
-         }
-
-       add_damage (offscreen, min_x, min_y,
-                   max_x - min_x + 1,
-                   max_y - min_y + 1,
-                   FALSE);
-    }
-}
-
 void
 _gdk_offscreen_window_new (GdkWindow     *window,
                           GdkScreen     *screen,
@@ -986,7 +949,6 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
 
   drawable_class->draw_rectangle = gdk_offscreen_window_draw_rectangle;
   drawable_class->draw_drawable_with_src = gdk_offscreen_window_draw_drawable;
-  drawable_class->draw_points = gdk_offscreen_window_draw_points;
 }
 
 static void
index 3df695be2950c186d1da87dc13344af97f4596ec..3d51dad5f17f371adf644b37d8b354b1038325b0 100644 (file)
@@ -51,10 +51,6 @@ static void   gdk_pixmap_draw_drawable  (GdkDrawable     *drawable,
                                         gint             width,
                                         gint             height,
                                         GdkPixmap       *original_src);
-static void   gdk_pixmap_draw_points    (GdkDrawable     *drawable,
-                                        GdkGC           *gc,
-                                        GdkPoint        *points,
-                                        gint             npoints);
 
 static void   gdk_pixmap_real_get_size  (GdkDrawable     *drawable,
                                          gint            *width,
@@ -115,7 +111,6 @@ gdk_pixmap_class_init (GdkPixmapObjectClass *klass)
   drawable_class->create_gc = gdk_pixmap_create_gc;
   drawable_class->draw_rectangle = gdk_pixmap_draw_rectangle;
   drawable_class->draw_drawable_with_src = gdk_pixmap_draw_drawable;
-  drawable_class->draw_points = gdk_pixmap_draw_points;
   drawable_class->get_depth = gdk_pixmap_real_get_depth;
   drawable_class->get_screen = gdk_pixmap_real_get_screen;
   drawable_class->get_size = gdk_pixmap_real_get_size;
@@ -234,18 +229,6 @@ gdk_pixmap_draw_drawable (GdkDrawable *drawable,
                                                                  original_src);
 }
 
-static void
-gdk_pixmap_draw_points (GdkDrawable *drawable,
-                       GdkGC       *gc,
-                       GdkPoint    *points,
-                       gint         npoints)
-{
-  GdkPixmapObject *private = (GdkPixmapObject *)drawable;
-
-  _gdk_gc_remove_drawable_clip (gc);  
-  gdk_draw_points (private->impl, gc, points, npoints);
-}
-
 static void
 gdk_pixmap_real_get_size (GdkDrawable *drawable,
                           gint *width,
index 0178c2dbe362a804e3362fb3fe64d80330a23943..0554954d3b8f1b850a023dbcd55c636a5763ea51 100644 (file)
@@ -246,10 +246,6 @@ static void   gdk_window_draw_drawable  (GdkDrawable     *drawable,
                                         gint             width,
                                         gint             height,
                                         GdkDrawable     *original_src);
-static void   gdk_window_draw_points    (GdkDrawable     *drawable,
-                                        GdkGC           *gc,
-                                        GdkPoint        *points,
-                                        gint             npoints);
 
 static cairo_surface_t *gdk_window_ref_cairo_surface (GdkDrawable *drawable);
 static cairo_surface_t *gdk_window_create_cairo_surface (GdkDrawable *drawable,
@@ -430,7 +426,6 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
   drawable_class->create_gc = gdk_window_create_gc;
   drawable_class->draw_rectangle = gdk_window_draw_rectangle;
   drawable_class->draw_drawable_with_src = gdk_window_draw_drawable;
-  drawable_class->draw_points = gdk_window_draw_points;
   drawable_class->get_depth = gdk_window_real_get_depth;
   drawable_class->get_screen = gdk_window_real_get_screen;
   drawable_class->get_size = gdk_window_real_get_size;
@@ -4194,41 +4189,6 @@ gdk_window_draw_drawable (GdkDrawable *drawable,
   END_DRAW;
 }
 
-static void
-gdk_window_draw_points (GdkDrawable *drawable,
-                       GdkGC       *gc,
-                       GdkPoint    *points,
-                       gint         npoints)
-{
-  GdkPoint *new_points;
-
-  if (GDK_WINDOW_DESTROYED (drawable))
-    return;
-
-  BEGIN_DRAW;
-
-  if (x_offset != 0 || y_offset != 0)
-    {
-      gint i;
-
-      new_points = g_new (GdkPoint, npoints);
-      for (i=0; i<npoints; i++)
-       {
-         new_points[i].x = points[i].x - x_offset;
-         new_points[i].y = points[i].y - y_offset;
-       }
-    }
-  else
-    new_points = points;
-
-  gdk_draw_points (impl, gc, new_points, npoints);
-
-  if (new_points != points)
-    g_free (new_points);
-
-  END_DRAW;
-}
-
 static cairo_t *
 setup_backing_rect (GdkWindow *window, GdkWindowPaint *paint, int x_offset_cairo, int y_offset_cairo)
 {
index 1f83a807bd1c535cb41c06254cdd6d0cfb6a6471..ec6ed52fb8a4ebda8f2e13b4ff068244af681e91 100644 (file)
@@ -265,32 +265,6 @@ gdk_quartz_draw_drawable (GdkDrawable *drawable,
                src_depth, dest_depth);
 }
 
-static void
-gdk_quartz_draw_points (GdkDrawable *drawable,
-                       GdkGC       *gc,
-                       GdkPoint    *points,
-                       gint         npoints)
-{
-  CGContextRef context = gdk_quartz_drawable_get_context (drawable, FALSE);
-  int i;
-
-  if (!context)
-    return;
-
-  _gdk_quartz_gc_update_cg_context (gc, drawable, context,
-                                   GDK_QUARTZ_CONTEXT_STROKE |
-                                   GDK_QUARTZ_CONTEXT_FILL);
-
-  /* Just draw 1x1 rectangles */
-  for (i = 0; i < npoints; i++) 
-    {
-      CGRect rect = CGRectMake (points[i].x, points[i].y, 1, 1);
-      CGContextFillRect (context, rect);
-    }
-
-  gdk_quartz_drawable_release_context (drawable, context);
-}
-
 static inline void
 gdk_quartz_fix_cap_not_last_line (GdkGCQuartz *private,
                                  gint         x1,
@@ -342,7 +316,6 @@ gdk_drawable_impl_quartz_class_init (GdkDrawableImplQuartzClass *klass)
   drawable_class->create_gc = _gdk_quartz_gc_new;
   drawable_class->draw_rectangle = gdk_quartz_draw_rectangle;
   drawable_class->draw_drawable_with_src = gdk_quartz_draw_drawable;
-  drawable_class->draw_points = gdk_quartz_draw_points;
 
   drawable_class->ref_cairo_surface = gdk_quartz_ref_cairo_surface;
 
index b0a730b061feb6884c4cc895f2d25ea3663cbad9..fae749f5e86e0ba0e826e2ad67eaf25126a95d53 100644 (file)
@@ -65,10 +65,6 @@ static void gdk_win32_draw_drawable  (GdkDrawable    *drawable,
                                      gint            width,
                                      gint            height,
                                      GdkDrawable    *original_src);
-static void gdk_win32_draw_points    (GdkDrawable    *drawable,
-                                     GdkGC          *gc,
-                                     GdkPoint       *points,
-                                     gint            npoints);
 
 static cairo_surface_t *gdk_win32_ref_cairo_surface (GdkDrawable *drawable);
      
@@ -101,7 +97,6 @@ _gdk_drawable_impl_win32_class_init (GdkDrawableImplWin32Class *klass)
   drawable_class->create_gc = _gdk_win32_gc_new;
   drawable_class->draw_rectangle = gdk_win32_draw_rectangle;
   drawable_class->draw_drawable_with_src = gdk_win32_draw_drawable;
-  drawable_class->draw_points = gdk_win32_draw_points;
   
   drawable_class->ref_cairo_surface = gdk_win32_ref_cairo_surface;
   
@@ -775,37 +770,6 @@ gdk_win32_draw_drawable (GdkDrawable *drawable,
                   xdest, ydest, width, height);
 }
 
-static void
-gdk_win32_draw_points (GdkDrawable *drawable,
-                      GdkGC       *gc,
-                      GdkPoint    *points,
-                      gint         npoints)
-{
-  HDC hdc;
-  HGDIOBJ old_pen;
-  int i;
-
-  hdc = gdk_win32_hdc_get (drawable, gc, GDK_GC_FOREGROUND);
-  
-  GDK_NOTE (DRAW, g_print ("gdk_win32_draw_points: %s %d points\n",
-                          _gdk_win32_drawable_description (drawable),
-                          npoints));
-
-  /* The X11 version uses XDrawPoint(), which doesn't use the fill
-   * mode, so don't use generic_draw. But we should use the current
-   * function, so we can't use SetPixel(). Draw single-pixel
-   * rectangles (sigh).
-   */
-
-  old_pen = SelectObject (hdc, GetStockObject (NULL_PEN));
-  for (i = 0; i < npoints; i++)
-    Rectangle (hdc, points[i].x, points[i].y,
-              points[i].x + 2, points[i].y + 2);
-
-  SelectObject (hdc, old_pen);
-  gdk_win32_hdc_release (drawable, gc, GDK_GC_FOREGROUND);
-}
-
 static void
 blit_from_pixmap (gboolean              use_fg_bg,
                  GdkDrawableImplWin32 *dest,
index 4261c6f9beac6d0db01c888602106d1d25d32844..53cd107ed2abed5a6b57c5291c89a55a62ee0641 100644 (file)
@@ -65,10 +65,6 @@ static void gdk_x11_draw_drawable  (GdkDrawable    *drawable,
                                    gint            width,
                                    gint            height,
                                    GdkDrawable    *original_src);
-static void gdk_x11_draw_points    (GdkDrawable    *drawable,
-                                   GdkGC          *gc,
-                                   GdkPoint       *points,
-                                   gint            npoints);
 
 static cairo_surface_t *gdk_x11_ref_cairo_surface (GdkDrawable *drawable);
      
@@ -97,7 +93,6 @@ _gdk_drawable_impl_x11_class_init (GdkDrawableImplX11Class *klass)
   drawable_class->create_gc = _gdk_x11_gc_new;
   drawable_class->draw_rectangle = gdk_x11_draw_rectangle;
   drawable_class->draw_drawable_with_src = gdk_x11_draw_drawable;
-  drawable_class->draw_points = gdk_x11_draw_points;
   
   drawable_class->ref_cairo_surface = gdk_x11_ref_cairo_surface;
 
@@ -400,49 +395,6 @@ gdk_x11_draw_drawable (GdkDrawable *drawable,
                src_depth, dest_depth);
 }
 
-static void
-gdk_x11_draw_points (GdkDrawable *drawable,
-                    GdkGC       *gc,
-                    GdkPoint    *points,
-                    gint         npoints)
-{
-  GdkDrawableImplX11 *impl;
-
-  impl = GDK_DRAWABLE_IMPL_X11 (drawable);
-
-  
-  /* We special-case npoints == 1, because X will merge multiple
-   * consecutive XDrawPoint requests into a PolyPoint request
-   */
-  if (npoints == 1)
-    {
-      XDrawPoint (GDK_SCREEN_XDISPLAY (impl->screen),
-                 impl->xid,
-                 GDK_GC_GET_XGC (gc),
-                 points[0].x, points[0].y);
-    }
-  else
-    {
-      gint i;
-      XPoint *tmp_points = g_new (XPoint, npoints);
-
-      for (i=0; i<npoints; i++)
-       {
-         tmp_points[i].x = points[i].x;
-         tmp_points[i].y = points[i].y;
-       }
-      
-      XDrawPoints (GDK_SCREEN_XDISPLAY (impl->screen),
-                  impl->xid,
-                  GDK_GC_GET_XGC (gc),
-                  tmp_points,
-                  npoints,
-                  CoordModeOrigin);
-
-      g_free (tmp_points);
-    }
-}
-
 static gint
 gdk_x11_get_depth (GdkDrawable *drawable)
 {